package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxUserrechargeMapper;
import com.ruoyi.ylyx.domain.YlyxUserrecharge;
import com.ruoyi.ylyx.service.IYlyxUserrechargeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户充值Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxUserrechargeServiceImpl implements IYlyxUserrechargeService 
{
    @Autowired
    private YlyxUserrechargeMapper ylyxUserrechargeMapper;

    /**
     * 查询用户充值
     * 
     * @param id 用户充值ID
     * @return 用户充值
     */
    @Override
    public YlyxUserrecharge selectYlyxUserrechargeById(String id)
    {
        return ylyxUserrechargeMapper.selectYlyxUserrechargeById(id);
    }

    /**
     * 查询用户充值列表
     * 
     * @param ylyxUserrecharge 用户充值
     * @return 用户充值
     */
    @Override
    public List<YlyxUserrecharge> selectYlyxUserrechargeList(YlyxUserrecharge ylyxUserrecharge)
    {
        return ylyxUserrechargeMapper.selectYlyxUserrechargeList(ylyxUserrecharge);
    }

    /**
     * 新增用户充值
     * 
     * @param ylyxUserrecharge 用户充值
     * @return 结果
     */
    @Override
    public int insertYlyxUserrecharge(YlyxUserrecharge ylyxUserrecharge)
    {
        ylyxUserrecharge.setCreateTime(DateUtils.getNowDate());
        return ylyxUserrechargeMapper.insertYlyxUserrecharge(ylyxUserrecharge);
    }

    /**
     * 修改用户充值
     * 
     * @param ylyxUserrecharge 用户充值
     * @return 结果
     */
    @Override
    public int updateYlyxUserrecharge(YlyxUserrecharge ylyxUserrecharge)
    {
        return ylyxUserrechargeMapper.updateYlyxUserrecharge(ylyxUserrecharge);
    }

    /**
     * 删除用户充值对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxUserrechargeByIds(String ids)
    {
        return ylyxUserrechargeMapper.deleteYlyxUserrechargeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户充值信息
     * 
     * @param id 用户充值ID
     * @return 结果
     */
    @Override
    public int deleteYlyxUserrechargeById(String id)
    {
        return ylyxUserrechargeMapper.deleteYlyxUserrechargeById(id);
    }
}
